# Contributor: Will Sinatra <wpsinatra@gmail.com>
# Maintainer: Will Sinatra <wpsinatra@gmail.com>
pkgname=lua-mimetypes
_pkgname=mimetypes
pkgver=0_git20240207
_commit=fd570b2dff729b430c42d7bd6a767c197d38384b
pkgrel=0
pkgdesc="Lua library designed to provide a non-server bound mime type database."
url="https://github.com/tst2005/lua-mimetypes"
arch="noarch"
license="MIT"
source="$pkgname-$pkgver.tar.gz::https://github.com/tst2005/lua-mimetypes/archive/$_commit.tar.gz"
builddir="$srcdir/$pkgname-$_commit"
options="!check"
subpackages="$pkgname-doc"

package() {
	local destdir="$pkgdir/usr/share/lua/common/"
	local rockdir="$pkgdir/usr/lib/luarocks/rocks-common/$_pkgname/$pkgver-1"

	mkdir -p "$destdir"
	cp generate.lua "$destdir"/
	cp mimetypes.lua "$destdir"/

	mkdir -p "$rockdir"
	echo 'rock_manifest = {}' > "$rockdir"/rock_manifest

	install -Dm644 "$builddir"/LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

sha512sums="
ace0ec495492e24ce9e34be2994e748e14f24794f0052ed42c9a0c12000d580f1d155c22f652bf85a6375c95b67cd92e4a0d7c337b69f87d22281c407c3092ee  lua-mimetypes-0_git20240207.tar.gz
"
